//
// Created by Jisam on 2024/6/19.
//
#include <bits/stdc++.h>
using namespace std;

using i64 = long long;
void solve(){
    i64 n;
    cin >> n;
    if(n % 3 != 0){
        cout <<"0 " <<  n % 3 + n / 3 <<"\n";
    }else {
        cout <<"1 "<< n/3 <<"\n";
    }
}

int main(){
    ios::sync_with_stdio(false);
    cin.tie(nullptr);

    int t;
    cin >> t;
    while( t -- ){
        solve();
    }
}
